// phalanx is_movable.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

#ifndef IG_PHALANX_MOVE_DETAIL_IS_MOVABLE_HPP_CU_ONCE_
#define IG_PHALANX_MOVE_DETAIL_IS_MOVABLE_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

#include <phalanx/move/detail/rvalue.hpp.cu>

#include <phalanx/type_traits/is_convertible.hpp.cu>
#include <phalanx/type_traits/is_class.hpp.cu>

namespace phalanx
{

namespace move_detail
{

template < typename T, bool = is_class< T >::value >
struct is_movable_impl
  : public false_type {};

template < typename T >
struct is_movable_impl< T, true >
  : public is_convertible< T, rv_< T > & > {};

template < typename T >
struct is_movable_impl< rv_< T >, true >
  : public false_type {};

template < typename T >
struct is_movable
  : public is_movable_impl< T > {};

} // namespace move_detail

} // namespace phalanx

#endif // IG_PHALANX_MOVE_DETAIL_IS_MOVABLE_HPP_CU_ONCE_

